🎖️GitЯра🎖️
Commit 735a57bc704befd7337d6f3854ee76bb49786618
Parents : ae5afc9
Author : James Rich <2199651+jamesarich@users.noreply.github.com>
Signature : Signature validation error
Date : 2026-07-01T14:01:09-05:00
Committer : GitHub <noreply@github.com>
Date : 2026-07-01T19:01:09Z
fix(connections): label the connecting-card button "Stop Connecting" (#6046)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Changes
6 files changed, 27 insertions(+), 3 deletions(-)
Diff
diff --git a/.skills/compose-ui/strings-index.txt b/.skills/compose-ui/strings-index.txt
index f0191541a6..924d89b38d 100644
--- a/.skills/compose-ui/strings-index.txt
+++ b/.skills/compose-ui/strings-index.txt
@@ -1390,6 +1390,7 @@ state_broadcast_seconds
status_message
status_message_config
stay_connected_anywhere
+stop_connecting
store_forward
store_forward_config
store_forward_enabled
diff --git a/core/resources/src/commonMain/composeResources/values/strings.xml b/core/resources/src/commonMain/composeResources/values/strings.xml
index c8465f5f05..d1caff2d35 100644
--- a/core/resources/src/commonMain/composeResources/values/strings.xml
+++ b/core/resources/src/commonMain/composeResources/values/strings.xml
@@ -1432,6 +1432,7 @@
<string name="status_message">Status Message</string>
<string name="status_message_config">Status Message Config</string>
<string name="stay_connected_anywhere">Stay Connected Anywhere</string>
+ <string name="stop_connecting">Stop Connecting</string>
<string name="store_forward">Store & Forward</string>
<string name="store_forward_config">Store & Forward Config</string>
<string name="store_forward_enabled">Store & Forward enabled</string>
diff --git a/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/components/ConnectingDeviceInfo.kt b/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/components/ConnectingDeviceInfo.kt
index a3aff424b4..b266ac5fb0 100644
--- a/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/components/ConnectingDeviceInfo.kt
+++ b/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/components/ConnectingDeviceInfo.kt
@@ -37,9 +37,11 @@ import org.meshtastic.core.resources.Res
import org.meshtastic.core.resources.connected
import org.meshtastic.core.resources.connected_sleeping
import org.meshtastic.core.resources.connecting
+import org.meshtastic.core.resources.disconnect
import org.meshtastic.core.resources.must_set_region
import org.meshtastic.core.resources.not_connected
import org.meshtastic.core.resources.reconnecting
+import org.meshtastic.core.resources.stop_connecting
import org.meshtastic.core.ui.viewmodel.ConnectionStatus
/**
@@ -65,6 +67,21 @@ fun ConnectingDeviceInfo(
ConnectionStatus.NOT_CONNECTED -> stringResource(Res.string.not_connected)
}
+ // This card also renders when the transport is already CONNECTED but node info hasn't arrived yet
+ // (or the region needs setting), so only the not-yet-established states get "Stop Connecting".
+ val disconnectLabel =
+ when (connectionStatus) {
+ ConnectionStatus.CONNECTED,
+ ConnectionStatus.CONNECTED_SLEEPING,
+ ConnectionStatus.MUST_SET_REGION,
+ -> stringResource(Res.string.disconnect)
+
+ ConnectionStatus.CONNECTING,
+ ConnectionStatus.RECONNECTING,
+ ConnectionStatus.NOT_CONNECTED,
+ -> stringResource(Res.string.stop_connecting)
+ }
+
Column(modifier = modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) {
Row(
modifier = Modifier.fillMaxWidth(),
@@ -84,6 +101,6 @@ fun ConnectingDeviceInfo(
}
}
- DisconnectButton(onClick = onClickDisconnect)
+ DisconnectButton(onClick = onClickDisconnect, label = disconnectLabel)
}
}
diff --git a/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/components/DisconnectButton.kt b/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/components/DisconnectButton.kt
index f077d4b456..a86d54b83c 100644
--- a/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/components/DisconnectButton.kt
+++ b/feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/components/DisconnectButton.kt
@@ -32,13 +32,18 @@ import org.meshtastic.core.resources.disconnect
* Centralises the color/label so every call site stays in lock-step.
*/
@Composable
-fun DisconnectButton(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true) {
+fun DisconnectButton(
+ onClick: () -> Unit,
+ modifier: Modifier = Modifier,
+ enabled: Boolean = true,
+ label: String = stringResource(Res.string.disconnect),
+) {
OutlinedButton(
modifier = modifier.fillMaxWidth(),
colors = ButtonDefaults.outlinedButtonColors(contentColor = MaterialTheme.colorScheme.error),
enabled = enabled,
onClick = onClick,
) {
- Text(stringResource(Res.string.disconnect))
+ Text(label)
}
}
diff --git a/screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/ConnectionsScreenshotTestsKt/ScreenshotConnectingDeviceInfo_Dark_d19fbf1f_0.png b/screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/ConnectionsScreenshotTestsKt/ScreenshotConnectingDeviceInfo_Dark_d19fbf1f_0.png
index d563d182d0..231fe7ea14 100644
Binary files a/screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/ConnectionsScreenshotTestsKt/ScreenshotConnectingDeviceInfo_Dark_d19fbf1f_0.png and b/screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/ConnectionsScreenshotTestsKt/ScreenshotConnectingDeviceInfo_Dark_d19fbf1f_0.png differ
diff --git a/screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/ConnectionsScreenshotTestsKt/ScreenshotConnectingDeviceInfo_Light_b29dc7a7_0.png b/screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/ConnectionsScreenshotTestsKt/ScreenshotConnectingDeviceInfo_Light_b29dc7a7_0.png
index 573d8b84d4..d727fb0a5b 100644
Binary files a/screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/ConnectionsScreenshotTestsKt/ScreenshotConnectingDeviceInfo_Light_b29dc7a7_0.png and b/screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/ConnectionsScreenshotTestsKt/ScreenshotConnectingDeviceInfo_Light_b29dc7a7_0.png differ
Served by rngit 1.5.4 - Generated in 0.1s